package com.voice.core.connection;

import com.voice.core.connection.callback.StreamListener;

import java.io.InputStream;
import java.util.concurrent.CompletableFuture;

public interface ConnectionWriter {

    CompletableFuture<Integer> writeHeaders(byte[] bytes, boolean endStream, StreamListener streamListener);

    CompletableFuture<Integer> writeHeaders(byte[] bytes, boolean endStream, StreamListener streamListener,Runnable writeCallback);

    CompletableFuture<Integer> writeHeaders(int streamId,byte[] bytes, boolean endStream, StreamListener streamListener);

    CompletableFuture<Integer> writeHeaders(int streamId,byte[] bytes, boolean endStream, StreamListener streamListener,Runnable writeCallback);

    CompletableFuture<Integer> writeData(int streamId, byte[] bytes, boolean endStream);

    CompletableFuture<Integer> writeData(int streamId, byte[] bytes, boolean endStream,Runnable writeCallback);

    void writePing(long data);

    void writeStream(InputStream inputStream);

    CompletableFuture<Integer> writeGoAway(int errorCode, byte[]  debugData);

    CompletableFuture<Integer> writeGoAway(int errorCode, byte[]  debugData,Runnable writeCallback);

}
